<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="myTags" tagdir="/WEB-INF/tags/components" %>
<%@ attribute name="location" required="true" %>
<%@ attribute name="message" required="true" type="beans.Message" rtexprvalue="true" %>

<!-- Author: Minh-Tuan Ta -->

<div class="messageFullDiv">
	<c:if test="${message.sender.userID == User.userID || message.reciever.userID == User.userID }">
		<div class="messageSender">From: <myTags:SmallUserBlock user="${message.sender}"></myTags:SmallUserBlock></div>
		<div class="messageTitle">Title: ${message.contentTitle }</div>
		<div class="messageNav">
			<span class="linkButton"><a href="Messages?location=${location }">Return to ${location }</a></span>
			<c:if test="${location == 'inbox' }"><span class="linkButton"><a href="ReplyMessage?messageID=${message.contentID }">Reply to this message</a></span></c:if>
			<form action="DeleteMessage" method="post">
				<input type="hidden" name="messageID" value="${message.contentID }" />
				<input type="hidden" name="location" value="${location }" />
				<input type="submit" name="submit" value="Delete Message" />
			</form>
		</div>
		<div class="messageContent">${message.content }</div>
	</c:if>
</div>